home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994…tember: Reference Library / Dev.CD Sep 94.toast / Periodicals / develop / develop Issue 3 / develop 3 code / Surf's Up! / CSurfer / Surfer.r < prev    next >
Encoding:
Text File  |  1992-09-14  |  6.2 KB  |  310 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Products Presents
  4. #
  5. #    S U R F E R    ----- A CommToolbox Sample Application
  6. #        by Alex Kazim
  7. #
  8. #    Based on the MacDTS Simple Sample Application
  9. #
  10. #    Surfer.r    -    Rez Source
  11. #
  12. #    Copyright © 1988-9 Apple Computer, Inc.
  13. #    All rights reserved.
  14. #
  15. #    Versions:    Sample 1.0                    08/88
  16. #                Sample 1.01                    11/88
  17. #                Surfer 0.5                    08/89
  18. #                Surfer 1.01                    02/90
  19. ------------------------------------------------------------------------------*/
  20.  
  21.  
  22. #include "Types.r"
  23. #include "SysTypes.r"
  24. #include "Surfer.h"
  25.  
  26.  
  27. /* So the Finder can tell who we are    */
  28.  
  29. resource 'vers' (1) {
  30.     0x01, 
  31.     0x00, 
  32.     development, 
  33.     0x12, 
  34.     verUS,
  35.     "1.01",
  36.     "1.01, Copyright © Apple Computer, Inc. 1988-1990.  Written by Alex Kazim"
  37. };
  38.  
  39.  
  40. /* we use an MBAR resource to conveniently load all the menus */
  41.  
  42. resource 'MBAR' (rMenuBar, preload) {
  43.     { mApple, mFile, mEdit, mSettings };    /* four menus */
  44. };
  45.  
  46.  
  47. resource 'MENU' (mApple, preload) {
  48.     mApple, textMenuProc,
  49.     AllItems & ~MenuItem2,    /* Disable dashed line, enable About and DAs */
  50.     enabled, apple,
  51.     {
  52.         "About Surfer…",
  53.             noicon, nokey, nomark, plain;
  54.         "-",
  55.             noicon, nokey, nomark, plain
  56.     }
  57. };
  58.  
  59. resource 'MENU' (mFile, preload) {
  60.     mFile, textMenuProc,
  61.     MenuItem15,                /* enable Quit only, program enables others */
  62.     enabled, "File",
  63.     {
  64.         "New",
  65.             noicon, "N", nomark, plain;
  66.         "Open",
  67.             noicon, "O", nomark, plain;
  68.         "-",
  69.             noicon, nokey, nomark, plain;
  70.         "Close",
  71.             noicon, "W", nomark, plain;
  72.         "Save",
  73.             noicon, "S", nomark, plain;
  74.         "Save As…",
  75.             noicon, nokey, nomark, plain;
  76.         "Revert",
  77.             noicon, nokey, nomark, plain;
  78.         "-",
  79.             noicon, nokey, nomark, plain;
  80.         "Send File",
  81.             noicon, "T", nomark, plain;
  82.         "Receive File",
  83.             noicon, "R", nomark, plain;
  84.         "-",
  85.             noicon, nokey, nomark, plain;
  86.         "Page Setup…",
  87.             noicon, nokey, nomark, plain;
  88.         "Print…",
  89.             noicon, nokey, nomark, plain;
  90.         "-",
  91.             noicon, nokey, nomark, plain;
  92.         "Quit",
  93.             noicon, "Q", nomark, plain
  94.     }
  95. };
  96.  
  97. resource 'MENU' (mEdit, preload) {
  98.     mEdit, textMenuProc,
  99.     NoItems,                /* disable everything, program does the enabling */
  100.     enabled, "Edit",
  101.      {
  102.         "Undo",
  103.             noicon, "Z", nomark, plain;
  104.         "-",
  105.             noicon, nokey, nomark, plain;
  106.         "Cut",
  107.             noicon, "X", nomark, plain;
  108.         "Copy",
  109.             noicon, "C", nomark, plain;
  110.         "Paste",
  111.             noicon, "V", nomark, plain;
  112.         "Clear",
  113.             noicon, nokey, nomark, plain
  114.     }
  115. };
  116.  
  117. resource 'MENU' (mSettings, preload) {
  118.     mSettings, textMenuProc,
  119.     NoItems,                /* disable everything, program does the enabling */
  120.     enabled, "Settings",
  121.      {
  122.         "Connection…",
  123.             noicon, "1", nomark, plain;
  124.         "File Transfer…",
  125.             noicon, "2", nomark, plain;
  126.         "Terminal…",
  127.             noicon, "3", nomark, plain
  128.     }
  129. };
  130.  
  131.  
  132. /* this ALRT and DITL are used as an About screen */
  133.  
  134. resource 'ALRT' (rAboutAlert, purgeable) {
  135.     {40, 20, 180, 400},
  136.     rAboutAlert,
  137.     { /* array: 4 elements */
  138.         /* [1] */
  139.         OK, visible, silent,
  140.         /* [2] */
  141.         OK, visible, silent,
  142.         /* [3] */
  143.         OK, visible, silent,
  144.         /* [4] */
  145.         OK, visible, silent
  146.     }
  147. };
  148.  
  149. resource 'DITL' (rAboutAlert, purgeable) {
  150.     {    /* array DITLarray: 5 elements */
  151.         /* [1] */
  152.         {99, 285, 119, 365},
  153.         Button {
  154.             enabled,
  155.             "OK"
  156.         },
  157.         /* [2] */
  158.         {8, 8, 26, 250},
  159.         StaticText {
  160.             disabled,
  161.             "SURFER: A CommToolbox Application"
  162.         },
  163.         /* [3] */
  164.         {103, 6, 120, 251},
  165.         StaticText {
  166.             disabled,
  167.             "Copyright © 1988-90 Apple Computer."
  168.         },
  169.         /* [4] */
  170.         {52, 8, 69, 204},
  171.         StaticText {
  172.             disabled,
  173.             "Bytes by Alex, Words by Rob"
  174.         },
  175.         /* [5] */
  176.         {86, 6, 103, 211},
  177.         StaticText {
  178.             disabled,
  179.             "Based on Sample from MacDTS"
  180.         }
  181.     }
  182. };
  183.  
  184.  
  185. /* this ALRT and DITL are used as an error screen */
  186.  
  187. resource 'ALRT' (rUserAlert, purgeable) {
  188.     {40, 20, 180, 350},
  189.     rUserAlert,
  190.     { /* array: 4 elements */
  191.         /* [1] */
  192.         OK, visible, silent,
  193.         /* [2] */
  194.         OK, visible, silent,
  195.         /* [3] */
  196.         OK, visible, silent,
  197.         /* [4] */
  198.         OK, visible, silent
  199.     }
  200. };
  201.  
  202.  
  203. resource 'DITL' (rUserAlert, purgeable) {
  204.     { /* array DITLarray: 3 elements */
  205.         /* [1] */
  206.         {100, 230, 120, 310},
  207.         Button {
  208.             enabled,
  209.             "OK"
  210.         },
  211.         /* [2] */
  212.         {10, 60, 76, 310},
  213.         StaticText {
  214.             disabled,
  215.             "^0"
  216.         },
  217.         /* [3] */
  218.         {8, 8, 40, 40},
  219.         Icon {
  220.             disabled,
  221.             2
  222.         }
  223.     }
  224. };
  225.  
  226.  
  227. resource 'WIND' (rWindow, preload, purgeable) {
  228.     {40, 5, 340, 512},
  229.     noGrowDocProc, visible, noGoAway, 0x0, "Surf the Wave"
  230. };
  231.  
  232. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  233.  
  234. resource 'SIZE' (-1) {
  235.     dontSaveScreen,
  236.     acceptSuspendResumeEvents,
  237.     enableOptionSwitch,
  238.     canBackground,
  239.     doesActivateOnFGSwitch,
  240.     backgroundAndForeground,
  241.     dontGetFrontClicks,
  242.     ignoreAppDiedEvents,
  243.     is32BitCompatible,
  244.     isHighLevelEventAware,
  245.     localAndRemoteHLEvents,
  246.     notStationeryAware,                
  247.     reserved,
  248.     reserved,
  249.     reserved,
  250.     reserved,
  251.     kPrefSize * 1024,
  252.     kMinSize * 1024        
  253. };
  254.  
  255. resource 'BNDL' (rBNDL) {
  256.     'SurF',
  257.     0,
  258.     {    /* array TypeArray: 2 elements */
  259.         /* [1] */
  260.         'FREF',
  261.         {    /* array IDArray: 1 elements */
  262.             /* [1] */
  263.             0, 128
  264.         },
  265.         /* [2] */
  266.         'ICN#',
  267.         {    /* array IDArray: 1 elements */
  268.             /* [1] */
  269.             0, 128
  270.         }
  271.     }
  272. };
  273.  
  274. data 'SurF' (0, "Owner resource") {
  275.     $"3B 43 6F 70 79 72 69 67 68 74 20 31 39 38 38 2D"    /* ;Copyright 1988- */
  276.     $"39 30 20 41 70 70 6C 65 20 43 6F 6D 70 75 74 65"    /* 90 Apple Compute */
  277.     $"72 20 49 6E 63 2E 20 20 41 6C 6C 20 52 69 67 68"    /* r Inc.  All Righ */
  278.     $"74 73 20 52 65 73 65 72 76 65 64 2E"                /* ts Reserved. */
  279. };
  280.  
  281. resource 'FREF' (rBNDL) {
  282.     'APPL',
  283.     0,
  284.     ""
  285. };
  286.  
  287. resource 'ICN#' (rBNDL) {
  288.     {    /* array: 2 elements */
  289.         /* [1] */
  290.         $"04 00 00 00 20 80 00 2C 0E 02 00 50 11 07 00 00"
  291.         $"51 4A 80 00 11 0A 81 60 0E 0A 82 90 20 9A 40 00"
  292.         $"04 12 40 00 00 12 50 40 00 12 48 80 00 12 47 00"
  293.         $"00 12 47 00 00 12 47 00 FF F2 77 7F 04 12 42 11"
  294.         $"40 52 4F 80 00 12 7F C4 01 12 7F C0 48 12 4F C0"
  295.         $"00 12 47 48 00 12 47 40 00 92 47 42 24 12 4F 80"
  296.         $"00 12 4D 80 00 12 4D 90 20 92 48 82 02 12 48 80"
  297.         $"00 12 58 C0 20 0F 98 C8 00 00 00 00 04 42 22 02",
  298.         /* [2] */
  299.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  300.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  301.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  302.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  303.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  304.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  305.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  306.         $"FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
  307.     }
  308. };
  309.  
  310.